/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package ghanaroutes.entities;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.validation.constraints.Size;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author User
 */
@Entity
@Table(name = "popularplaces")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "Popularplaces.findAll", query = "SELECT p FROM Popularplaces p"),
    @NamedQuery(name = "Popularplaces.findByPlaceId", query = "SELECT p FROM Popularplaces p WHERE p.placeId = :placeId"),
    @NamedQuery(name = "Popularplaces.findByPlaceName", query = "SELECT p FROM Popularplaces p WHERE p.placeName = :placeName"),
    @NamedQuery(name = "Popularplaces.findByCategory", query = "SELECT p FROM Popularplaces p WHERE p.category = :category"),
    @NamedQuery(name = "Popularplaces.findByDescription", query = "SELECT p FROM Popularplaces p WHERE p.description = :description"),
    @NamedQuery(name = "Popularplaces.findByVerificationCode", query = "SELECT p FROM Popularplaces p WHERE p.verificationCode = :verificationCode"),
    @NamedQuery(name = "Popularplaces.findByDateAdded", query = "SELECT p FROM Popularplaces p WHERE p.dateAdded = :dateAdded")})
public class Popularplaces implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(name = "placeId")
    private Integer placeId;
    @Size(max = 50)
    @Column(name = "placeName")
    private String placeName;
    @Size(max = 50)
    @Column(name = "category")
    private String category;
    @Size(max = 200)
    @Column(name = "description")
    private String description;
    @Size(max = 10)
    @Column(name = "verificationCode")
    private String verificationCode;
    @Column(name = "dateAdded")
    @Temporal(TemporalType.TIMESTAMP)
    private Date dateAdded;

    public Popularplaces() {
    }

    public Popularplaces(Integer placeId) {
        this.placeId = placeId;
    }

    public Popularplaces(Integer placeId, Date dateAdded) {
        this.placeId = placeId;
        this.dateAdded = dateAdded;
    }

    public Integer getPlaceId() {
        return placeId;
    }

    public void setPlaceId(Integer placeId) {
        this.placeId = placeId;
    }

    public String getPlaceName() {
        return placeName;
    }

    public void setPlaceName(String placeName) {
        this.placeName = placeName;
    }

    public String getCategory() {
        return category;
    }

    public void setCategory(String category) {
        this.category = category;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    public String getVerificationCode() {
        return verificationCode;
    }

    public void setVerificationCode(String verificationCode) {
        this.verificationCode = verificationCode;
    }

    public Date getDateAdded() {
        return dateAdded;
    }

    public void setDateAdded(Date dateAdded) {
        this.dateAdded = dateAdded;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (placeId != null ? placeId.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Popularplaces)) {
            return false;
        }
        Popularplaces other = (Popularplaces) object;
        if ((this.placeId == null && other.placeId != null) || (this.placeId != null && !this.placeId.equals(other.placeId))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "ghanaroutes.entities.Popularplaces[ placeId=" + placeId + " ]";
    }
    
}
